package epin.fujiajun.data.array;

import epin.fujiajun.data.Array;

import java.util.Random;

/**
 * Created by DELL on 2017/8/29.
 */
public class Int extends Array<Int> {

    public static int[] createArray(int size, int range){
        int[] a = new int[size];
        Random random = new Random();

        for (int i = 0;i < size;i++){
            a[i] = random.nextInt(range) + 1;
        }

        return a;
    }


    public static void print(int[] a){
        int N = a.length;

        for (int i = 0;i < N;i++){
            System.out.print(a[i]);
            if (i != N-1)
                System.out.print(",\t");
            if (((i+1) % 10) == 0)
                System.out.println();
        }
    }


    public static boolean isSmallToLarge(int[] a){
        int N = a.length;

        for (int i = 1;i < N;i++){
            if (a[i-1] > a[i])
                return false;
        }

        return true;
    }

    @Override
    public int compareTo(Int o) {
        return 0;
    }
}
